// components/diy/seckillgroup/index.js
import wxh from '../../../utils/wxh.js';
import { getSeckillIndexTime, getSeckillList } from '../../../api/activity.js';
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    diyPramas:{
      type:Object
    },
    diyStyle:{
      type:Object
    },
    diyData:{
      type:Object
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    activeTime:'',
    countDownHour: "00",
    countDownMinute: "00",
    countDownSecond: "00",
  },

  /**
   * 组件的方法列表
   */
  methods: {
    getSeckillConfig: function () {
      let that = this; 
      getSeckillIndexTime().then(res=>{ 
        that.setData({ timeList: res.data.seckillTime});
        var timeList = res.data.seckillTime
        var active = res.data.seckillTimeIndex
        var activeTime = timeList[active]
        this.setData({
          activeTime:activeTime.time
        })
      });
    },

  },
  ready(){
      //获取秒杀数据
      this.getSeckillConfig();
  },
})
